package com.ss.SmartStock.controller.admin;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ss.SmartStock.common.BaseResponse;
import com.ss.SmartStock.common.ResultUtils;
import com.ss.SmartStock.pojo.entity.Log;
import com.ss.SmartStock.service.LogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author TsingFeng
 * @date 2024/6/19 19:20
 */
@Slf4j
@RestController
@Api(tags = "日志管理接口")
@RequestMapping("/admin/log")
public class LogController {


    @Autowired
    private LogService logService;

    @GetMapping("/log/list")
    @ApiOperation("查询日志")
    public IPage<Log> getLogs(
            @RequestParam(value = "curPage", defaultValue = "1") int curPage,
            @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
        log.info("查询日志");
        return logService.selectPageLogs(curPage, pageSize);
    }

}
